<template>
  <div class="home_container">
    <vHeader />
    <vSidebar />
    <div
      class="content-box"
      :class="{ hideSidebar: this.$store.getters.isCollapse }"
    >
      <v-tags @tags="tags"></v-tags>
      <div class="content">
        <transition name="move" mode="out-in">
          <keep-alive :include="tagsList">
            <router-view />
          </keep-alive>
        </transition>
      </div>
    </div>
  </div>
</template>

<script>
import vHeader from "../common/Header.vue";
import vSidebar from "../common/Sidebar.vue";
import vTags from "../common/Tag.vue";
import { mapGetters } from "vuex";
export default {
  data() {
    return {
      tagsList: [],
    };
  },
  created() {},
  components: {
    vHeader,
    vSidebar,
    vTags,
  },
  methods: {
    tags(param) {
      param.forEach((item) => {
        item.name && this.tagsList.push(item.name);
      });
    },
  },
};
</script>

<style lang="less" scoped>
.home_container {
  position: relative;
  min-width: 100%;
  height: 100%;

  .content-box {
    position: absolute;
    left: 250px;
    right: 0;
    top: 70px;
    height: calc(100% - 70px);
    bottom: 0;
    padding-bottom: 30px;
    -webkit-transition: left 0.3s ease-in-out;
    transition: left 0.3s ease-in-out;
    background: #f0f0f0;

    .content {
      min-width: 1080px;
      height: 100%;
      padding: 12px;
      overflow-y: auto;
      // background-color: #fff;
    }
  }
  .hideSidebar {
    left: 64px;
  }
}
</style>